package com.blockmeta.bbs.businesslibrary.baselist;

import android.content.Context;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.ArrayList;
import java.util.List;

public abstract class BaseListAdapter<T> extends BaseQuickAdapter<T, BaseViewHolder> {
    private Context mContext;
    private List<T> tagDatas = new ArrayList<>();
    int mLayoutId;

    /**
     * Same as QuickAdapter#QuickAdapter(Context,int) but with
     * some initialization data.
     *
     * @param data A new list is created out of this one to avoid mutable list
     */
    public BaseListAdapter(List<T> data, int mLayoutId, Context mContext) {
        super(mLayoutId, data);
        this.mLayoutId = mLayoutId;
        this.tagDatas = data;
        this.mContext = mContext;
    }

    @Override
    protected void convert(BaseViewHolder helper, T item) {
        bindView(helper, item);
    }

    protected abstract void bindView(BaseViewHolder helper, T item);

}
